package com.api.mapper;

import com.api.pojo.Emigration;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface EmigrationMapper {

    @Insert("insert into emigration(uid, content, file) value(#{uid}, #{content}, #{file})")
    void create(Emigration emigration);

    @Delete("delete from emigration where id = #{id}")
    void remove(Integer id);

    @Update("update emigration set content = #{content}, file = #{file}, state = #{state}, executor = #{executor}, et = #{et} where id = #{id}")
    void update(Emigration emigration);

    @Select("select * from emigration limit #{pageNo}, #{pageSize}")
    List<Emigration> get(Integer pageNo, Integer pageSize);

    @Select("select count(*) from emigration")
    Integer count();
}
